package com.myj.jim.service.impl;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestMapping;

import com.myj.jim.dao.FileTransferDao;
import com.myj.jim.domain.FileTransfer;
import com.myj.jim.domain.bootstraptable.BootstrapTable;
import com.myj.jim.domain.bootstraptable.BootstrapTableJSON;
import com.myj.jim.service.FileTransferService;

@Service
public class FileTransferServiceImpl implements FileTransferService {
	@Autowired
	private FileTransferDao fileTransferDao;
	
	public BootstrapTableJSON<FileTransfer> findPage(Map<String,Object> map){
		BootstrapTableJSON<FileTransfer> btj = new BootstrapTableJSON<FileTransfer>();
		
		btj.setTotal(fileTransferDao.count(map));
		btj.setRows(fileTransferDao.findPage(map));
		return btj;
	}

	@Override
	public boolean save(FileTransfer ft) {
		return fileTransferDao.insert(ft)!=0;
	}

	@Override
	public boolean delete(Integer id) {
		return fileTransferDao.deleteByPrimaryKey(id)!=0;
	}
	@Override
	public boolean update(FileTransfer ft){
		return fileTransferDao.updateByPrimaryKeySelective(ft)!=0;
	}
}
